package LoginPackage;



import org.testng.annotations.Test;

import PagePackage.MyPageFactory;
import PagePackage.internalPageClass;
import PagePackage.loginPageClass;
import PagePackage.newSchoolPage;
import LoginPackage.TestBaseClass;


public class NewSchoolClass extends TestBaseClass{
	
	@Test (priority=1)
  public void AdminCreatesNewCollege() {
		goToMainPage(); 
		checkPage();
		MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@krossover.com", "webmaster") 
		.clickschooltab()
		.clickAddNewSchoolButton();
        MyPageFactory.getPage(driver, newSchoolPage.class).chooseType("University/College")
		.schoolName("Selenium University")
		.mascot("Selenium University Mascot")
		.conference("Selenium University Conference")
		.division("Selenium University Division")
		.address1("125 Forest Ave")
		.address2("App.4")
		.city("Philadelphia")
		.country("US")
		.state("PA")
		.postal("00123")
		.saveSchool()
		.findSchool("Selenium University")
		.scrollAndClickSchool(0, 0, "//*[text()='Selenium University']");
        driver.get("https://www-dev.krossover.com/intelligence-qa/schools");
		 MyPageFactory.getPage(driver, internalPageClass.class).logout();
		 
		 }
		
		

			
			
	@Test (priority=2)		
 public void AdminCreatesNewHighSchool() {
				goToMainPage();
				checkPage();
				MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@krossover.com", "webmaster")
		        .clickschooltab()
				.clickAddNewSchoolButton();
		        MyPageFactory.getPage(driver, newSchoolPage.class).chooseType("High School")
				.schoolName("Selenium High School")
				.mascot("Selenium High School Mascot")
				.conference("Selenium High School Conference")
				.division("Selenium High School Division")
				.address1("148 24th street ")
				.address2("App.4")
				.city("New York")
				.country("US")
				.state("NY")
				.postal("11011")
				.saveSchool()
				.findSchool("Selenium High School")
				.scrollAndClickSchool(0, 0, "//*[text()='Selenium High School']");
		        driver.get("https://www-dev.krossover.com/intelligence-qa/schools");
				 MyPageFactory.getPage(driver, internalPageClass.class).logout();
				 
				 }
				
			
				
			
	@Test (priority=3)		
 
			 public void AdminCreatesNewOtherSchool() {		
				goToMainPage();
				checkPage();
				MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@krossover.com", "webmaster")
		        .clickschooltab()
				.clickAddNewSchoolButton();
		        MyPageFactory.getPage(driver, newSchoolPage.class).chooseType("Other")
				.schoolName("Selenium Other School")
				.mascot("Selenium Other School Mascot")
				.conference("Selenium Other Conference")
				.division("Selenium Other Division")
				.address1("148 24th street ")
				.address2("App.4")
				.city("New York")
				.country("US")
				.state("NY")
				.postal("11011")
				.saveSchool()
				.findSchool("Selenium Other School")
				.scrollAndClickSchool(0, 0, "//*[text()='Selenium Other School']");				
		        driver.get("https://www-dev.krossover.com/intelligence-qa/schools");
				 MyPageFactory.getPage(driver, internalPageClass.class).logout();
			}
				
	@Test (priority=4)	
			 public void AdminCancelsNewSchool() {		
							
				goToMainPage();
				checkPage();
				MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@krossover.com", "webmaster");
				 
				 MyPageFactory.getPage(driver, internalPageClass.class).clickschooltab()
				.clickAddNewSchoolButton();
		        MyPageFactory.getPage(driver, newSchoolPage.class).chooseType("Other")
				.schoolName("Selenium Other School Cancel")
			    .cancelSchool()
			    .findSchool("Selenium Other School Cancel")
				.scrollAndClickSchool2(0, 0, "//*[text()='Selenium Other School Cancel']");
		        driver.get("https://www-dev.krossover.com/intelligence-qa/schools");
				 MyPageFactory.getPage(driver, internalPageClass.class).logout();
							 }
							 
	@Test (priority=5)	
			
			  public void SACreatesNewCollege() {
					goToMainPage(); 
					checkPage();
					
					MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@victoria.com", "webmaster") 
				    .clickschooltab()
					.clickAddNewSchoolButton();
			        MyPageFactory.getPage(driver, newSchoolPage.class).chooseType("University/College")
					.schoolName("Selenium University SA")
					.mascot("Selenium University Mascot SA")
					.conference("Selenium University Conference SA")
					.division("Selenium University Division SA")
					.address1("125 Forest Ave")
					.address2("App.4")
					.city("Philadelphia")
					.country("US")
					.state("PA")
					.postal("00123")
					.saveSchool()
					.findSchool("Selenium University SA")
					.scrollAndClickSchool(0, 0, "//*[text()='Selenium University SA']");
					 driver.get("https://www-dev.krossover.com/intelligence-qa/schools");
					 MyPageFactory.getPage(driver, internalPageClass.class).logout();
								 }
					 
					 
					
						

					
	@Test (priority=6)				
						
			 public void SACreatesNewHighSchool() {	 
							 
							goToMainPage();
							checkPage();
							MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@victoria.com", "webmaster")
							.clickschooltab()
							.clickAddNewSchoolButton();
					        MyPageFactory.getPage(driver, newSchoolPage.class).chooseType("High School")
							.schoolName("Selenium High School SA")
							.mascot("Selenium High School Mascot SA")
							.conference("Selenium High School Conference SA")
							.division("Selenium High School Division SA")
							.address1("148 24th street ")
							.address2("App.4")
							.city("New York")
							.country("US")
							.state("NY")
							.postal("11011")
							.saveSchool()
							.findSchool("Selenium High School SA")
							.scrollAndClickSchool(0, 0, "//*[text()='Selenium High School SA']");
							driver.get("https://www-dev.krossover.com/intelligence-qa/schools");
							 MyPageFactory.getPage(driver, internalPageClass.class).logout();
							 
							 }
							
						
			 		
							
	@Test (priority=7)					
						
						 public void SACreatesNewOtherSchool() {		 
							goToMainPage();
							checkPage();
							MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@victoria.com", "webmaster")
						
							.clickschooltab()
							.clickAddNewSchoolButton();
					        MyPageFactory.getPage(driver, newSchoolPage.class).chooseType("Other")
							.schoolName("Selenium Other School SA")
							.mascot("Selenium Other School Mascot SA")
							.conference("Selenium Other Conference SA")
							.division("Selenium Other Division SA")
							.address1("148 24th street ")
							.address2("App.4")
							.city("New York")
							.country("US")
							.state("NY")
							.postal("11011")
							.saveSchool()
							.findSchool("Selenium Other School SA")
							.scrollAndClickSchool(0, 0, "//*[text()='Selenium Other School SA']");				
							driver.get("https://www-dev.krossover.com/intelligence-qa/schools");
							 MyPageFactory.getPage(driver, internalPageClass.class).logout();
						}
	@Test (priority=8)		
						 		
						 public void SACancelsNewSchool() {		
										
							goToMainPage();
							checkPage();
							MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@victoria.com", "webmaster")
							.clickschooltab()
							.clickAddNewSchoolButton();
					        MyPageFactory.getPage(driver, newSchoolPage.class).chooseType("Other")
							.schoolName("Selenium Other School Cancel SA")
						    .cancelSchool()
				            .findSchool("Selenium Other School Cancel SA")
							.scrollAndClickSchool2(0, 0, "//*[text()='Selenium Other School Cancel SA']");
					        driver.get("https://www-dev.krossover.com/intelligence-qa/schools");
							 MyPageFactory.getPage(driver, internalPageClass.class).logout();
										 }
										 
										 
}
		 